// wx.request({
//     url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/catitems',
//     success:(res)=>{
//         this.setData({
//           navList:res.data.message
//       })
//     }
//   })

export const request = (params) => {
    const baseUrl = "https://api-hmugo-web.itheima.net/api/public/v1"
    return new Promise((reslove, reject) => {
        wx.request({
            ...params,
            url:baseUrl+params.url,
            success: (res) => {
                reslove(res)
            },
            fail: (err) => {
                reject(err)
            },
            complete: () => {
                wx.hideLoading()
            }
        })
    })
}
export let showmodal = (content) => {
    return new Promise((a, b) => {
        wx.showModal({
            title: '提示',
            content: content,
            success: (res) => {
                a(res)
            }
        })

    })

}